function [ lA , lX ] = inversionAm( data , Params  )

HousePrice = data.HousePrice ;
Ez = data.Ez ;
W = data.W ;
pop = data.pop ;
lL = data.lL ;

% Get amenities
A = pop.^( 1 / Params.nu ) .* HousePrice.^Params.omega ...
    .* ( 1 - Params.beta + Params.beta * Ez ) ./ W  ;

lA = log(A) ;
lA = lA - mean(lA) ;

% Get composite index
lX = (   ( Params.omega + Params.eps ) * lL ...
        - Params.psi * lA ) ...
      / Params.P1 ;

end

